#include "fxcc/imgui/Editor.h"
#include "fxcc/core/graph/common/MaterialData.h"
#include "fxcc/core/graph/common/RenderStates.h"

using namespace fxcc::graph::common;
using namespace fxcc::imgui;

template <>
bool Editor::Edit<MaterialData>(const std::string& label, MaterialData& inst)
{
    int index = 0;

    EditInst<std::string>("m_Name", inst.m_Name);
    EditInst<std::string>("m_Dir", inst.m_Dir);

    EditMapInst<std::string>("m_Strings", inst.m_Strings);
    EditInst<fxcc::graph::common::Params>("m_Params", inst.m_Params);

    for (auto& [key, value] : inst.m_Textures)
    {
        ImGui::Text("%s", key.c_str());
        const int sz = value.m_Textures.size();
        for (int i = 0; i < sz; i++)
        {
            std::string indexLabel = std::to_string(i);
            EditInst<std::string>(indexLabel.c_str(), value.m_Textures[i]);
        }
    }
    return false;
}
